#include "../Common/asr.hpp"
#include <gflags/gflags.h>
DEFINE_bool(log_mod,false,"true为发布模式,false为调试模式");
DEFINE_string(log_file,"","发布模式下日志存储的文件");
DEFINE_int32(log_level,0,"要输出的日志等级");
DEFINE_string(app_id,"6253207","百度云语音识别应用ID");
DEFINE_string(api_key,"vTqCJzZsCIkFu2xIMkjZZJZd","百度云语音识别平台API密钥");
DEFINE_string(secret_key,"lwJxakCG106OxRZOQLuQ1Br6Ashf2ke9","百度云语音识别平台加密密钥");


int main(int argc,char* argv[])
{
    google::ParseCommandLineFlags(&argc,&argv,true);
    init_logger(FLAGS_log_mod,FLAGS_log_file,(spdlog::level::level_enum)FLAGS_log_level);
    ASRClient client(FLAGS_app_id, FLAGS_api_key, FLAGS_secret_key);
    std::string file_content;
    aip::get_file_content("16k.pcm", &file_content);
    std::string ret = client.recognize(file_content);
    if(ret.size())
    std::cout<<ret;
    else
    return -1;
    return 0;
}